<template>
    <div>
        <input type="text" v-model="msg">
        <h2>{{msg | msgFilter}}</h2>
    </div>
</template>
<script>
export default {
    data(){
        return {
            msg:1
        }
    },
    filters:{
        msgFilter(value){
            let result = "壹";
            switch(value){
                case "1":result = "壹";break;
                case "2":result = "贰";break;
                case "3":result = "叁";break;
                case "4":result = "肆";break;
                case "5":result = "伍";break;
                case "6":result = "陆";break;
                case "7":result = "柒";break;
                case "8":result = "捌";break;
                case "9":result = "玖";break;
                case "0":result = "零";break;
            }
            return result;
        }
    }
}
</script>